package com.wangxin.study8.threadtest;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
 * @author jojo.wang
 * @title: ExecutorsSubmit
 * @projectName study8
 * @description: TODO
 * @date 2019/5/714:45
 */

public class ExecutorsSubmit {
    public static void main(String[] args) throws Exception{
        Callable<String> callable = ()->{
            return "AAAA";
        };
        ExecutorService executorService = Executors.newFixedThreadPool(2);
        Future<String> future =  executorService.submit(callable);
        System.out.println(future.get());
        executorService.shutdown();
    }
}
